package co.gov.medellin.ssti.sub.model.dao.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.jdbc.core.namedparam.NamedParameterJdbcDaoSupport;

import co.gov.medellin.ssti.sub.model.dao.ErrorDAO;

public class ErrorDAOImpl2 extends NamedParameterJdbcDaoSupport implements
		ErrorDAO {

	private static final String INSERT_BEN_REGISTRO_ERRORES = "INSERT INTO TCS_BEN_REGISTRO_ERRORES "
			+ "(CODIGO, NOMBRE, DESCRIPCION) "
			+ "VALUES (SCS_BEN_RER.NEXTVAL, :NOMBRE, :DESCRIPCION)";

	public int insertError(String strName, String strDescription) {
		Map<String, Object> namedParameters = new HashMap<String, Object>();

		namedParameters.put("NOMBRE", strName);
		namedParameters.put("DESCRIPCION", strDescription);
		return getNamedParameterJdbcTemplate().update(
				INSERT_BEN_REGISTRO_ERRORES, namedParameters);

	}
}
